package com.example.demo.controller;

import com.example.demo.entity.Result;
import com.example.demo.service.impl.ButtonServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController
@RequestMapping("sys/button")
public class ButtonController {
    @Autowired
    private ButtonServiceImpl buttonService;

    @GetMapping("getAllButton")
    public Result getAllFinance(@RequestParam Map<String,Object> params, HttpServletRequest request){
        return buttonService.getAllButton(params);
    }

    @PostMapping("insertButton")
    public Result insertButton(@RequestBody Map<String,Object> params, HttpServletRequest request){
        return buttonService.insertButton(params);
    }

    @PostMapping("insertRoleButton")
    public Result insertRoleButton(@RequestBody Map<String,Object> params, HttpServletRequest request){
        return buttonService.insertRoleButton(params);
    }
    @GetMapping("getRoleButton")
    public Result getRoleButton(@RequestParam Map<String,Object> params, HttpServletRequest request){
        return buttonService.getRoleButton(params);
    }

    @GetMapping("getUserButton")
    public Result getUserButton(@RequestParam Map<String,Object> params, HttpServletRequest request){
        return buttonService.getUserButton(params);
    }
}
